package gfx;

public class GraphicString{
	// chaine x y GraphicImage
	
	/*** ATTRIBUTS ***/
	
	private String string; // string to display
	private int x; // string's position (in pixels) at start
	private int y; // string's position (in pixels) at start 
	private GraphicImage image;
	
	
	/*** FIN ATTRIBUTS ***/
	
	
	/*** ACCESSEURS ***/
	
	public String getString() {
		return string;
	}
	
	public void setString(String string)  throws IllegalArgumentException {
		if (string.equals(null))
			throw new IllegalArgumentException ("Class GraphicString [method setString] invalid value (string is null)");
		else
			this.string = string;
	}
	
	public int getX() {
		return x;
	}
	
	public int getY() {
		return y;
	}
	
	public void setCoordonate(int x, int y){
		this.x = x ;//no conditions
		this.y = y; //no conditions
	}
	
	public GraphicImage getImage() {
		return image;
	}
	
	public void setImage(GraphicImage image) throws IllegalArgumentException {
		if (image != null)
			this.image =image;
		else
			throw new IllegalArgumentException ("Class GraphicSprites [class setImage] image is invalid (value null)");
	}
	
	/*** FIN ACCESSEURS ***/
	
	
	/*** CONSTRUCTEUR ***/
	
	public GraphicString (int x, int y, String string, GraphicImage image){
		this.setCoordonate(x, y);
		this.setString(string);
		this.setImage(image);
	}
	
	/*** FIN CONSTRUCTEUR ***/
	
	
}
